//
// Created by 12992 on 24-10-26.
//
#include <iostream>
#include <gtest/gtest.h>
#include "base64.h"

using namespace std;

TEST(TEST_BASE64, ctor)
{
    ASSERT_NO_THROW(
        {
        crypto::base64 b64;
        });
}

TEST(TEST_BASE64, encrypto)
{
    string res;
    ASSERT_NO_THROW
    ({
        crypto::base64 b64;
        res = b64.encrypt("hello world");
        cout << res << endl;
        });
    ASSERT_EQ(res, "aGVsbG8gd29ybGQ=");
}

TEST(TEST_BASE64, decrypto)
{
    string res;
    ASSERT_NO_THROW
    ({
        crypto::base64 b64;
        res = b64.decrypt("aGVsbG8gd29ybGQ=");
        cout << res << endl;
        });
    ASSERT_EQ(string("hello world"), res);
}
